//
//  ViewController.swift
//  scrollView约束
//
//  Created by slience on 2019/8/8.
//  Copyright © 2019 shehuiren. All rights reserved.
//

import UIKit
import MJRefresh
class ViewController: UIViewController {

    @IBOutlet weak var myScrollView : UIScrollView!
    
     var mjHeader: MJRefreshNormalHeader?
    
    override func viewDidLoad() {
        super.viewDidLoad()
        
         mjHeader = MJRefreshNormalHeader.makeHeader(self, refreshingAction: #selector(refreshData))
        
        myScrollView.mj_header = mjHeader   
       
    }
    
    //下拉刷新
    @objc func refreshData(){
        
        self.perform(#selector(stop), with: nil, afterDelay: 1.0)
    }

    @objc func stop(){
        
        mjHeader?.endRefreshing()  
    }

}

